<?php
header('Access-Control-Allow-Origin:*'); 
/**
 * 取得token值
 */
function getToken(String $username,String $password){
    $password = md5($password);
    $token = Mgetone("select token from admin where username = '$username' and password = '$password'");
    return $token;
}
/**
 * token 合法检验
 */
function checkToken(String $token){
    $count = Mgetone("select count(*) from admin where token = '$token'");
    if ($count == 0 ) return false;
    else return true;
}
?>